<!--
    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<!--
    Copyright 2019 Joyent, Inc.
-->

{{#if uuid}}
    <h4>Modify Existing Firewall Rule</h4>
{{else}}
    <h4>New Firewall Rule</h4>
{{/if}}

<form method="post" class="form-horizontal" role="form">
    <div class="form-group">
        <div class="col-sm-12">
            <div class="input-group">
                <span class="input-group-addon">FROM</span>
                <input type="text" class="form-control" name="fromPredicate">
            </div>
        </div>
    </div>

    <input name="owner_uuid" type="hidden">

    <div class="form-group">
        <div class="col-sm-12">
            <div class="input-group">
                <span class="input-group-addon">TO</span>
                <input type="text" class="form-control" name="toPredicate">
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-2" style="padding-right:0;">
            <select name="action" class="form-control">
                <option value="ALLOW">ALLOW</option>
                <option value="BLOCK">BLOCK</option>
            </select>
        </div>
        <div class="col-sm-10" style="padding-left:0;">
            <input type="text" class="form-control" name="actionPredicate">
        </div>
    </div>

    <div class="form-group form-group-global">
        <div class="col-sm-12">
            <div class="checkbox">
                <label>
                    <input type="checkbox" name="global" value="false"> Global Rule (Applies to all VMs in this datacenter)
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-12">
            <div class="checkbox enabled">
                <label>
                    <input type="checkbox" name="enabled" value="true"> Enable this rule
                </label>
            </div>
        </div>
    </div>


    <div class="form-group">
        <div class="col-sm-12">
            <div class="checkbox">
                <label>
                    <input type="checkbox" name="log" value="true"> Log connections matching this rule
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-12">
            <button type="submit" class="btn btn-info"><i class="fa fa-floppy-o"></i> Save</i></button>
            <button type="button" class="btn cancel btn-link"><i class="fa fa-times"></i> Cancel</i></button>
        </div>
    </form>
